<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/9/10 0010
 * Time: 16:03
 */

namespace App\Helps;

use Swoole\Table;

class TableStore
{
    protected $table;

    public function __construct()
    {
        $this->table = new Table(16);
        $this->table->column('user_id', Table::TYPE_INT);
        $this->table->column('fd', Table::TYPE_INT);
        $this->table->create();
        var_dump(123);
    }

    public function set(string $key, array $value)
    {
        return $this->table->set($key, $value);
    }

    public function get(string $key, string $field = null)
    {
        return $this->table->get($key, $field);
    }
}
